Ext.onReady(function(){
    Ext.QuickTips.init();

    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

   // var bd = Ext.getBody();

    /*
     * ================  Simple form  =======================
     */
   // bd.createChild({tag: 'h2', html: 'Form 1 - Very Simple'});


    var simple = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        url:'save-form.php',
        frame:true,
        //title: 'Register',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        //defaultType: 'textfield',

        items: [{
        	    xtype:'textfield',
                fieldLabel: 'First Name',
                name: 'first',
                
                allowBlank:false
            },{
            	xtype:'textfield',
                fieldLabel: 'Last Name',
                name: 'last',
                allowBlank:false
            },{
            	xtype:'textfield',
                fieldLabel: 'PhoneNo',
                name: 'phoneno',
                allowBlank:false
            }, {
            	xtype:'textfield',
                fieldLabel: 'Email',
                name: 'email',
                allowBlank:false,
                vtype:'email'
            }, {
            	xtype:'textfield',
                fieldLabel: 'Password',
                name: 'password',
               inputType:'password',
               allowBlank:false
                //vtype:'email'
            }, {
            	xtype:'textfield',
                fieldLabel: 'Confirm',
                name: 'cpassword',
                inputType:'password',
                allowBlank:false,
                validator: function(value) {
                    var password = this.previousSibling('[name=password]');
                    return (value === password.getValue()) ? true : 'Passwords do not match.'
                }
                //vtype:'email'
            },
            {
            	xtype:'textarea',
            	fieldLabel:'Address',
            	name:'address'
            }
        ]

    });

    simple.render(document.body);
})